package com.iecas.handler;

import com.iecas.launch.Client;
import com.iecas.launch.Server;
import com.iecas.request.DeadReq;
import com.iecas.request.Root;
import com.iecas.response.BaseResponse;

import javax.swing.*;
import java.nio.channels.SocketChannel;

public class DeadReqHandler extends BaseHandler {

    @Override
    BaseResponse handle(Root baseRequest, Server server, Client client, SocketChannel socketChannel) {
        DeadReq req = (DeadReq) baseRequest;
        client.close();
        SwingUtilities.invokeLater(Client::new);
        return null;
    }
}
